package com.fushenlan.epidemicControl.controller;


import com.fushenlan.Vo.*;
import com.fushenlan.commons.GeneralResponse;
import com.fushenlan.commons.ListPagingUtils;
import com.fushenlan.epidemicControl.dto.BuildingInfoDto;
import com.fushenlan.epidemicControl.service.WorkbenchService;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;


/**
 * @ClassName
 * @Description TODO
 * @Author17918
 * @Date2022/4/22
 * @Version 1.0
 */
@Slf4j
@RestController
@RequestMapping("/workbench")
public class WorkbenchController {

    @Resource
    private WorkbenchService workbenchService;


    /**
     * 工作台信息
     *
     * @return
     */
    @ApiOperation("工作台两个顶部数据")
    @RequestMapping(value = "/topData", method = RequestMethod.POST)
    public GeneralResponse<WorkBenchTopDataVO> topData() {
        return workbenchService.topData();
    }

    /**
     * 工作台信息
     *
     * @return
     */
    @ApiOperation("工作台核酸统计")
    @RequestMapping(value = "/nucleicInfo", method = RequestMethod.POST)
    public GeneralResponse<ListPagingUtils<WorkbenchNucleinVO>>nucleicInfo(int pageNo, int pageSize) {
        return workbenchService.nucleicInfo(pageNo,pageSize);
    }
    /**
     * 工作台信息
     *
     * @return
     */
    @ApiOperation("工作台紧急求助信息")
    @RequestMapping(value = "/emergencyInfo", method = RequestMethod.POST)
    public GeneralResponse<ListPagingUtils<WorkBenchEmergencyVO>> emergencyInfo(int pageNo, int pageSize) {
        return workbenchService.emergencyInfo(pageNo,pageSize);
    }

    /**
     * 根据小区id查看信息
     *
     * @param id 小区id
     * @return
     */
    @ApiOperation("工作台根据小区id查看信息")
    @RequestMapping(value = "/nucleicInfoDetail", method = RequestMethod.POST)
    public GeneralResponse<ListPagingUtils<WorkBenchDetailVO>>  detail(@RequestParam long id,int pageNo, int pageSize) {
        return workbenchService.detail(id,pageNo,pageSize);
    }




}
